<?
	$action = ( isset( $_POST['action'] ) && $_POST['action'] ? $_POST['action'] : 'data' );
	
	if( ( !isset( $_SERVER['HTTP_FLASH_UUID'] ) || $_SERVER['HTTP_FLASH_UUID'] != "oviedo-nd-zl" ) )	{
		echo "error=true&msg=Acceso Denegado";
		exit( );
	}
	
	if( $action == 'fileAccess' )	{
		$file = new File( );
		$file->setIdFile( $_POST['verify'] );
		if( ( $file->getProperty( "user" ) === $_POST['dlogin'] && $file->getProperty( "password" ) === $_POST['dpassword'] ) )	{
			session_start( );
			$_SESSION['sid'] = $_POST['verify'];
			$_SESSION['suser'] = $_POST['dlogin'];
			$_SESSION['spasswd'] = $_POST['dpassword'];
			echo "&error=false&msg=Access.";
		}
		else
			echo "&error=true&msg=User access denied.";
	}
	else	{
		echo "&error=true&msg=Petici%F3n incorrecta.";
	}
	//echo "&debug=" . print_r( $_SERVER, TRUE ) ;
?>